<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <script src="${ctx}/libjs/plugins/elecStationPicker/js/elecStationData.min.js"></script>
    <script src="${ctx}/libjs/plugins/elecStationPicker/js/elecStationPicker-2.0.4.js"></script>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/elecStationPicker/css/index.css">
    <script type="text/javascript" src="${ctx}/appjs/order/orderInfo/countOrderInfoPage.js"></script>
    <style>
        #countData {
            font-size: 15px;
            margin: 0 auto;
            /* text-align: center; */
            display: block;
            text-align: center;
            margin-top: 30px;
            font-weight: bold;
        }

        .mt-10 {
            margin-top: 10px !important;
        }

        .ml-30 {
            margin-left: 30px !important;
        }

        .searchable-select {
            border-radius: 0;
            width: 1.04rem !important;
            margin-left: 0 !important;
            height: 34px !important;
            /*display: block;*/
            /*margin-bottom: 10px;*/
        }

        .searchable-select-holder {
            width: 1.04rem;
            border: 1px solid #e5e6e7;
            height: 34px;
            border-radius: 3px;
            color: rgb(103, 106, 108) !important;

        }

        .searchable-select-dropdown input {
            width: 100% !important;
        }
    </style>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return '<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>报表统计</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>订单统计</strong>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a href="javascript:window.history.back()"><i class="fa fa-times"></i> 返回</a>' +
            '</li>' +
            '</ol>';
    });

    var has_add = '';
    var has_edit = '';
    var has_delete = '';
</script>

<body class="gray-bg">
<div class="wrapper wrapper-content " style="overflow-x: scroll">
    <div class="col-sm-12">
        <div class="ibox">
            <div class="ibox-body">
                <div class="row">
                    <%--<div class="columns pull-left">--%>
                    <%--<button type="button" class="btn  btn-primary" onclick="order.addOrder()">--%>
                    <%--增加桩群--%>
                    <%--</button>--%>
                    <%--</div>--%>
                    <div class="pull-left search ml-30">
                        <input id="startTime" name="startTime" type="text" class="form-control"
                               placeholder="开始时间">
                        <input id="detailStartTime" name="detailStartTime" type="text" autocomplete="off"
                               class="form-control mt-10"
                               placeholder="开始时段">
                        <%--<select type="text" class="form-control" name="bizType" id="bizType">--%>
                        <%--<option value="">是否自营</option>--%>
                        <%--<option value="0">自营</option>--%>
                        <%--<option value="1">非自营</option>--%>
                        <%--</select>--%>
                    </div>
                    <div class="pull-left search ml-30">
                        <input id="endTime" name="endTime" type="text" class="form-control"
                               placeholder="结束时间">
                        <input id="detailEndTime" name="detailEndTime" type="text" autocomplete="off"
                               class="form-control mt-10"
                               placeholder="结束时段">

                        <%--<input id="stationName" name="stationName" type="text" class="form-control mt-10"--%>
                        <%--placeholder="桩群选择">--%>
                        <%--<input id="elecStationId" name="elecStationId" type="text" class="form-control"--%>
                        <%--placeholder="桩群选择">--%>
                    </div>
                    <div class="pull-left search ml-30">
                        <select type="text" class="form-control" name="hlhtOrderType" id="hlhtOrderType">
                            <option value="">订单类型</option>
                            <option value="0">自有</option>
                            <option value="1">反向互联</option>
                            <option value="2">正向互联</option>
                            <option value="3">自有+反向互联</option>
                        </select>
                        <%--<select type="text" class="form-control" name="hlhtTenantOrHlhtOperator" style="display: block" id="hlhtOperatorId">--%>
                        <%--<option value="" selected>互联运营商</option>--%>
                        <%--&lt;%&ndash;<c:forEach items="${hlhtOperators}" var="hlhtOperators">&ndash;%&gt;--%>
                        <%--&lt;%&ndash;<option value="${hlhtOperators.hlhtOperatorId}">${hlhtOperators.hlhtOperatorName}</option>&ndash;%&gt;--%>
                        <%--&lt;%&ndash;</c:forEach>&ndash;%&gt;--%>
                        <%--</select>--%>
                        <input id="enterpriseMemberMobile" name="enterpriseMemberMobile" type="text"
                               class="form-control mt-10"
                               placeholder="企业主会员手机号">
                    </div>
                    <div class="pull-left search ml-30">
                        <select type="text" class="form-control" name="hlhtTenantOrHlhtOperator" style="display: block"
                                id="hlhtTenantOrHlhtOperator">
                            <option value="" selected>互联运营商</option>
                            <c:forEach items="${hlhtTenantList}" var="hlhtTenant">
                                <option value="${hlhtTenant.code}">${hlhtTenant.name}</option>
                            </c:forEach>
                        </select>
                        <input id="memberMobile" name="memberMobile" type="text" class="form-control mt-10"
                               placeholder="会员手机号">

                    </div>

                    <div class="pull-left search ml-30">
                        <select class="form-control" name="tenantCompanyId" id="tenantCompanyId">
                            <option value="">所属公司</option>
                            <c:forEach items="${tenantCompanyInfos}" var="tenantCompanyInfo">
                                <option value="${tenantCompanyInfo.tenantCompanyId}">${tenantCompanyInfo.companyName}</option>
                            </c:forEach>
                        </select>
                    </div>

                    <div class="pull-left search ml-30">
                        <shiro:hasPermission name="Statistics_order_reload">
                            <button class="btn btn-success" onclick="countOrderInfoPage.reLoad()">查询</button>
                        </shiro:hasPermission>
                        <shiro:hasPermission name="Statistics_order_export">
                            <button class="btn btn-success" onclick="countOrderInfoPage.exportCountOrderInfo()">导出
                            </button>
                        </shiro:hasPermission>
                    </div>
                    <div class="pull-left search">
                        <input id="stationName" name="stationName" type="hidden" autocomplete="off" class="form-control"
                               value="">
                    </div>
                </div>
                <%--//普通运营商桩群组件--%>
                <div class="row " style="padding-bottom: 0.1rem;!important;padding-top: 0 !important;">
                    <div class="dome-main">
                        <div class="city-picker-selector" id="city-picker-search"></div>
                        <!-- end .city-picker-selector -->
                        <input type="hidden" class="bizType" id="bizType" name="bizType">
                        <input type="hidden" class="elecStationId" id="elecStationId" name="elecStationId">
                    </div>

                </div>
                <%--//普通运营商桩群组件--%>
                <table id="exampleTable" style="word-break:break-all;" data-mobile-responsive="true">
                    <div id="main" style="width: 1000px;height:400px;margin: 0 auto"></div>
                    <span id="countData"></span>
                </table>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">

    var thisDate = new Date();
    var year = thisDate.getFullYear();
    var month = thisDate.getMonth() + 1;
    var date = thisDate.getDate();
    if (month < 10) {
        month = '0' + month
    }
    if (date < 10) {
        date = '0' + date
    }
    $('#startTime').val(year + '-' + month + '-' + date + ' ' + '00:00:00');

    $('#endTime').val(year + '-' + month + '-' + date + ' ' + '23:59:59');

    layui.use('laydate', function () {
        var laydate = layui.laydate;
        var startTime = laydate.render({
            elem: '#startTime',
            type: 'datetime',
            format: 'yyyy-MM-dd HH:mm:ss',
            trigger: 'click',
            done: function (value, dates) {
                endTime.config.min = {
                    year: dates.year,
                    month: dates.month - 1, //关键
                    date: dates.date,
                    hours: 0,
                    minutes: 0,
                    seconds: 0
                };
            }
        });
        var endTime = laydate.render({
            elem: '#endTime',
            type: 'datetime',
            format: 'yyyy-MM-dd HH:mm:ss',
            trigger: 'click'
        });

        var detailStartTime = laydate.render({
            elem: '#detailStartTime',
            type: 'time',
            format: 'HH:mm:ss',
            trigger: 'click'
        });


        var detailEndTime = laydate.render({
            elem: '#detailEndTime',
            type: 'time',
            format: 'HH:mm:ss',
            trigger: 'click'
        });

    });

    countOrderInfoPage.init()


</script>
</body>
</html>
<%--<script>--%>
<%--    function listHlhtOperator(hlhtOrderType) {--%>
<%--        $.ajax({--%>
<%--            "url": prefix + "/listHlhtOperator",--%>
<%--            "type": "GET",--%>
<%--            "data": {--%>
<%--                'hlhtOrderType': hlhtOrderType--%>
<%--            },--%>
<%--            "success": function (data) {--%>
<%--                console.log(data);--%>
<%--                $("#hlhtOperatorId").html("")--%>
<%--                var str = '<option value="" >互联运营商</option>'--%>
<%--                if(data.data){--%>
<%--                    for (var i = 0; i < data.data.length; i++) {--%>
<%--                        str += "<option value=" + data.data[i].hlhtOperatorId + " >" + data.data[i].hlhtOperatorName + "</option>";--%>

<%--                    }--%>
<%--                }--%>

<%--                $("#hlhtOperatorId").append(str);--%>
<%--                $("#hlhtOperatorId + div").remove()--%>
<%--                $('#hlhtOperatorId').searchableSelect();--%>
<%--                //console.log(str)--%>

<%--            },--%>
<%--            "complete": function () {--%>
<%--            }--%>
<%--        })--%>
<%--    }--%>
<%--    listHlhtOperator("");--%>

<%--    $("#hlhtOrderType").change(function () {--%>
<%--        listHlhtOperator($(this).val())--%>
<%--    })--%>
<%--</script>--%>
<script type="text/javascript">
    $(function () {
        $('#hlhtTenantOrHlhtOperator').searchableSelect();
    })
</script>